home *** CD-ROM | disk | FTP | other *** search
-
- /*
- There may be additional include files required depending
- upon the compile product you are using. Typical compilers
- include Microsoft C by Microsoft or Turbo C by Boland Int'l.
- */
- #include <stdio.h>
- main()
- {
- int i=0;
- char array[30];
-
- do{
- array[i]= getchar();
- }while(array[i++] != '\n' && i<29);
-
- /* Terminate the string with a null */
- array[i]='\0';
- printf("array is: %s\n",array);
- }
-